<%--
  Created by IntelliJ IDEA.
  User: jerry
  Date: 15/1/31
  Time: 下午4:41
  To change this template use File | Settings | File Templates.
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<head>
    <jsp:include page="/pages/include/includeCSS.jsp"></jsp:include>
    <script src="${pageContext.request.contextPath}/pages/assets/js/jquery-1.11.1.min.js"></script>
    <title>项目添加页面</title>
</head>
<body class="page-body">

<jsp:include page="/pages/admin/include/head_Settings-Pane.jsp"></jsp:include>
<jsp:include page="/pages/admin/include/leftPane.jsp"></jsp:include>

<jsp:include page="/pages/admin/include/includeHeadBar.jsp"></jsp:include>


<div class="page-loading-overlay">
    <div class="loader-2"></div>
</div>


<div class="page-title">

    <div class="title-env">
        <h1 class="title">项目添加</h1>

        <p class="description"> 项目明细 </p>
    </div>

    <div class="breadcrumb-env">

        <ol class="breadcrumb bc-1">
            <li>
                <a href="${pageContext.request.contextPath}"><i class="fa-home"></i>首页</a>
            </li>

            <li class="active">

                <strong><i class="fa-list"></i>项目列表</strong>
            </li>
        </ol>

    </div>

</div>


&numsp;&numsp;
<a href="${pageContext.request.contextPath}/app/manager/getPoject" ><button class="btn btn-blue btn-lg" type="button" ><i class="fa-mail-reply"></i>&numsp;返&numsp;&numsp;&numsp;&numsp;回 </button></a>
<!-- poject view list context -->


<!-- Basic Setup -->
<div class="panel panel-default">
    <div class="panel-heading">
        <h3 class="panel-title">项目添加</h3>

        <div class="panel-options">
            <a href="#" data-toggle="panel">
                <span class="collapse-icon">&ndash;</span>
                <span class="expand-icon">+</span>
            </a>
            <a href="#" data-toggle="remove">
                &times;
            </a>
        </div>
    </div>


    <div class="panel-body" id="poject">

        <form class="form-horizontal" action="${pageContext.request.contextPath}/app/manager/addPoject" method="post">

            <div class="form-group">
                <label class="col-sm-2 control-label" for="field-1">项目名称</label>

                <div class="col-sm-10">
                    <input type="text" class="form-control" id="field-1" placeholder="" name="projectName">
                </div>
            </div>


            <div class="form-group">
                <label class="col-sm-2 control-label" for="field-2" aria-hidden="">后台密码</label>

                <div class="col-sm-10">
                    <div id="field-2" class=""></div>
                    <span id="show-field-2"> ${backCoder}</span>
                    <input type="hidden" name="backCoder" value="${backCoder}">

                    <!--
                    <input type="text" class="col-sm-2 control-label" id="field-2" size="25"  placeholder="" disabled>
                    -->
                    &nbsp;&nbsp;
                    <button type="button" class="btn btn-success btn-xs" onclick="restCoder('field-2')">
                        重置
                        <i class="fa-refresh"></i>
                    </button>

                </div>

            </div>

            <div class="form-group">
                <label class="col-sm-2 control-label" for="field-3">营销经理</label>

                <div class="col-sm-10">
                    <div id="field-3" class=""></div>
                    <span id="show-field-3"> ${managerCoder}</span>

                    <input type="hidden" name="managerCoder" value="${managerCoder}">
                    <!--
                    <input type="text" class="col-sm-2 control-label" id="field-2" size="25"  placeholder="" disabled>
                    -->
                    &nbsp;&nbsp;
                    <button type="button" class="btn btn-success btn-xs" onclick="restCoder('field-3')">
                        重置
                        <i class="fa-refresh"></i>
                    </button>

                </div>
            </div>


            <!-- 分割线 -->

            <div class="form-group-separator"></div>

            <!-- 团队模版 -->




                <button class="btn btn-danger btn-lg" type="button" id="poject-team-add"><i class="fa-plus"></i>&numsp;添加团队</button>


                <!-- 分割线 -->

                <div class="form-group-separator"></div>


            <div id="poject_model">

                <br>

                <div class="form-group">
                    <label class="col-sm-2 control-label" for="poject-name" name="TTeams"><i class="fa-university"></i>&numsp;团队名称</label>

                    <div class="col-sm-10">
                        <input type="text" class="form-control" id="poject-name" placeholder="" name="TTeams">
                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-2 control-label" for="poject-manager" ><i class="fa-user"></i>&numsp;案场经理</label>

                    <div class="col-sm-10">
                        <div id="poject-manager" class=""></div>
                        <span id="show-poject-manager"> ${caseCoder}</span>
                        <input type="hidden" name="caseCoder" value="${caseCoder}">

                        <!--
                        <input type="text" class="col-sm-2 control-label" id="field-2" size="25"  placeholder="" disabled>
                        -->
                        &nbsp;&nbsp;
                        <button type="button" class="btn btn-success btn-xs" onclick="restCoder('field-2')">
                            重置
                            <i class="fa-refresh"></i>
                        </button>

                    </div>
                </div>

                <div class="form-group">
                    <label class="col-sm-2 control-label" for="poject-consultant"><i class="fa-male"></i>&numsp;置业顾问</label>

                    <div class="col-sm-10">
                        <div id="poject-consultant" class=""></div>
                        <span id="show-poject-consultant"> ${consultantCoder}</span>
                        <input type="hidden" name="consultantCoder" value="${consultantCoder}">

                        <!--
                        <input type="text" class="col-sm-2 control-label" id="field-2" size="25"  placeholder="" disabled>
                        -->
                        &nbsp;&nbsp;
                        <button type="button" class="btn btn-success btn-xs" onclick="restCoder('field-2')">
                            重置
                            <i class="fa-refresh"></i>
                        </button>

                    </div>
                </div>
                <br>



                <!-- tame 2 -->

                <div class="form-group-separator"></div>
            </div>
            <br>



            <div class="form-group">


                &numsp;&numsp;
                <a href="${pageContext.request.contextPath}/app/manager/getPoject" ><button class="btn btn-blue btn-lg " type="button" >返&numsp;&numsp;回</button></a>



                <div class="col-sm-10" align="right">
                    <button type="submit" class="btn btn-success btn-lg ">
                        保 &numsp;&numsp; 存
                        <i class="fa-submit"></i>
                    </button>
                </div>
            </div>

        </form>


    </div>
</div>


<jsp:include page="/pages/admin/include/includeFooter.jsp"></jsp:include>

<script>

    function restCoder(data) {
        $.ajax({
            url: "${pageContext.request.contextPath}/app/manager/restCoder",
            method: 'POST',
            dataType: 'json',


            success: function (resp) {
                // document.getElementById("#show-field-2").value = number[0];

                $("#show-field-2").html("");
                $("#show-field-2").append(resp.coder);

            }
        });
    }

    $("#poject-team-add").click(
            function () {

                var model = $("#poject_model").clone(true).appendTo("#poject_model"); //克隆模板，创建一个新数据行
               model.after(model);
                var No = parseInt(model.find("#poject_model").html())+1;

               var new_model = model.find("#poject_model").html(No);
                   //var delBut = model.append(" <div class='col-sm-10' align='right'><button type='butto' class='btn btn-success btn-sm btn-right'>delete &numsp;&numsp; 存 <i class='fa-submit'></i> </button> </div>");


                $("#poject").append(new_model);

            }
    );




</script>

<!-- Imported styles on this page -->
<link rel="stylesheet" href="${pageContext.request.contextPath}/pages/assets/js/datatables/dataTables.bootstrap.css">

<!-- Bottom Scripts -->
<script src="${pageContext.request.contextPath}/pages/assets/js/bootstrap.min.js"></script>
<script src="${pageContext.request.contextPath}/pages/assets/js/TweenMax.min.js"></script>
<script src="${pageContext.request.contextPath}/pages/assets/js/resizeable.js"></script>
<script src="${pageContext.request.contextPath}/pages/assets/js/joinable.js"></script>
<script src="${pageContext.request.contextPath}/pages/assets/js/xenon-api.js"></script>
<script src="${pageContext.request.contextPath}/pages/assets/js/xenon-toggles.js"></script>
<script src="${pageContext.request.contextPath}/pages/assets/js/datatables/js/jquery.dataTables.min.js"></script>


<!-- Imported scripts on this page -->
<script src="${pageContext.request.contextPath}/pages/assets/js/datatables/dataTables.bootstrap.js"></script>
<script src="${pageContext.request.contextPath}/pages/assets/js/datatables/yadcf/jquery.dataTables.yadcf.js"></script>
<script src="${pageContext.request.contextPath}/pages/assets/js/datatables/tabletools/dataTables.tableTools.min.js"></script>


<!-- JavaScripts initializations and stuff -->
<script src="${pageContext.request.contextPath}/pages/assets/js/xenon-custom.js"></script>

</body>
</html>
